#ifndef __COCOS_2DX_COMPONENT_H__
#define __COCOS_2DX_COMPONENT_H__

#include "gofgame/common/Ref.h"
#include "gofgame/common/ui/Component.h"
using namespace gofgame::common::ui;

namespace gofgame {
	namespace common {
		namespace ui {

			using namespace gofgame::common;

			class Cocos2dxComponent : public Component {
			public:
				Cocos2dxComponent(CCNode *contentNode, bool contentNodeInited);

				virtual bool init() _override;
				virtual void removeChild(CCNode* child) _override _final;
				virtual void removeChild(CCNode* child, bool cleanup) _override _final;
				virtual void removeChildByTag(int tag) _override _final;
				virtual void removeChildByTag(int tag, bool cleanup) _override _final;
				virtual void removeAllChildren() _override _final;
				virtual void removeAllChildrenWithCleanup(bool cleanup) _override _final;

				virtual void visit() _override;

			protected:
				CCNode *getContentNode() const;

			private:
				Ref<CCNode> contentNode;
				bool contentNodeInited;
			};
		}
	}
}

#endif //__COCOS_2DX_COMPONENT_H__
